Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 3 - Image Compression Manager / Image Compression Manager Reference
Image Compression Manager Functions / Working With Pictures and PICT Files


CompressPicture

The CompressPicture function compresses a single-frame image stored as a picture structure and places the result in another picture. If a picture with multiple pixel
maps and other graphical objects is passed, the pixel maps will be compressed individually and the other graphic objects will not be affected.

pascal OSErr CompressPicture (PicHandle srcPicture, 
                              PicHandle dstPicture, 
                              CodecQ quality, CodecType cType);
srcPicture
Contains a handle to the source image, stored as a picture.
dstPicture
Contains a handle to the destination for the compressed image. The compressor resizes this handle for the result data.
quality
Specifies the desired compressed image quality. See "Compression Quality Constants" beginning on page 3-57 for valid values.
cType
Specifies a compressor type. You must set this parameter to a
valid compressor type (see Table 3-3 on page 3-64 for a list of the available compressor types). If the value passed in is 0, or 'raw ', and the source picture is compressed, the destination picture is created as an uncompressed picture and does not require QuickTime to be displayed.
DESCRIPTION
The CompressPicture function compresses only image data. Any other types of data in the picture, such as text, graphics primitives, and previously compressed images, are not modified in any way and are passed through to the destination picture.

This function does not use the graphics port.

If your picture does not fit in memory, use the CompressPictureFile function, which is described on page 3-88.

This function supports parameters governing image quality and compressor type. The compressor infers the other compression parameters from the image data in the source picture.

SPECIAL CONSIDERATIONS
The CompressPicture function doesn't compress pictures that contain compressed data. Do not alter data in pictures that are already compressed. Instead use FCompressPicture, described in the next section.

RESULT CODES
noErr0No error
paramErr-50Invalid parameter specified
memFullErr-108Not enough memory available
noCodecErr-8961The Image Compression Manager could not find the specified compressor
SEE ALSO
If you need more control over the compression operation than is provided by the CompressPicture function, use the FCompressPicture function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996